// 生成columns
export const formatColumnContent = (formDesc) => {
  switch (formDesc.type) {
    case 0:
      return {
        type: "el-input",
        attrs: {
          placeholder: "请输入",
          type: "input",
          maxlength: formDesc.maxlength,
          disable: false
        }
      }
    case 1:
      return {
        type: "el-input",
        attrs: {
          placeholder: "请输入",
          type: "textarea",
          maxlength: formDesc.maxlength
        }
      }
    case 2:
      return {
        type: "el-radio-group",
        attrs: {},
        options: formDesc.options,
        on: {
        }
      }
    case 3:
      return {
        type: "el-checkbox-group",
        attrs: {
          size: 'medium',
        },
        options: formDesc.options,
        valueKey: formDesc.prop,
        rules: [{ required: true, type: 'array', message: '必填' }],
        // 组件事件
        on: {
        }
      }
    case 4:
      return {
        type: "el-select",
        attrs: {
          multiple: formDesc.selectedOption === 1 ? true :false
        },
        options: formDesc.options
      }
    case 5:
      return {
        type: "el-input-number",
        class: formDesc.numberType === 3 ? 'my-input-number' : '',
        attrs: {
          min: 0,
          max: formDesc.numberType === 3 ? 100 : 10000,
          precision: formDesc.numberType === 3 ? 2 : formDesc.numberType,
          step: 1,
          // controlsPosition: "right"
        },
      }
    case 6:
      // 引用数据
      return {
        type: "",
      }
  }
}